#include<iostream>
using namespace std;
class Date {
private:
	int year;
	int month;
	int date;
public:
	void Init(int y, int m, int d);
	int getYear();
	void setYear(int y);
	int getMonth();
	void setMonth(int m);
	int getDate();
	void setDate(int d);
	void display();
	int calWeekday();
};
void Date::Init(int y, int m, int d) {
	year = y;
	month = m;
	date = d;
}
int Date::getYear() {
	return year;
}
void Date::setYear(int y) {
	year = y;
}
int Date::getMonth() {
	return month;
}
void Date::setMonth(int m) {
	month = m;
}
int Date::getDate() {
	return date;
}
void Date::setDate(int d) {
	date = d;
}
void Date::display() {
	cout << year << "-" << month << "-" << date << endl;
}
int Date::calWeekday() {
	int y = year, m = month, d = date;
	if (m == 1 || m == 2) {
		y--;
		m += 12;
	}
	int weekday = (d + 2 * m + 3 * (m - 1) / 5 + y + y / 4 - y / 100 + y / 400 + 1) % 7;
	return weekday;
}
int main() {
	Date myDate;
	myDate.Init(2025, 1, 1);
	myDate.display();
	int weekday = myDate.calWeekday();
	cout << "星期";
	switch (weekday) {
	case 0:cout << "日"; break;
	case 1:cout << "一"; break;
	case 2:cout << "二"; break;
	case 3:cout << "三"; break;
	case 4:cout << "四"; break;
	case 5:cout << "五"; break;
	case 6:cout << "六"; break;
	}
	cout << endl;
	myDate.setYear(2024);
	myDate.setMonth(12);
	myDate.setDate(31);
	myDate.display();
	weekday = myDate.calWeekday();
	cout << "星期";
	switch (weekday) {
	case 0:cout << "日"; break;
	case 1:cout << "一"; break;
	case 2:cout << "二"; break;
	case 3:cout << "三"; break;
	case 4:cout << "四"; break;
	case 5:cout << "五"; break;
	case 6:cout << "六"; break;
	}
	cout << endl;
	cout << "读取年份" << myDate.getYear() << endl;
	cout << "读取月份" << myDate.getMonth() << endl;
	cout << "读取日期" << myDate.getDate() << endl;
	return 0;
}